﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Commerce.Base.Ubl.DataType
{
    /// <summary>
    /// A numeric value determined by measuring an object along with the specified unit of measure.
    /// </summary>
    public class Measure
    {
        private System.Decimal value = System.Decimal.Zero;
        private Code unitCode;

        /// <summary>
        /// The measure value.
        /// </summary>
        public System.Decimal Value
        {
            get { return this.value; }
            set { this.value = value; }
        }

        /// <summary>
        /// The type of unit of measure.
        /// </summary>
        public Code UnitCode
        {
            get { return unitCode; }
            set { unitCode = value; }
        }

        public Measure(System.Decimal value, Code unitCode)
        {
            this.value = value;
            this.unitCode = unitCode;
        }

        public override string ToString()
        {
            return string.Format("{0} {1}", this.value, this.unitCode);
        }
    }
}
